<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
    http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd">

  <!-- Used by org.geoserver.rest.RestConfiguration when setting up converters -->
  <bean id="gwcConverter" class="org.geowebcache.rest.converter.GWCConverter">
    <constructor-arg ref="gwcAppCtx" />
  </bean>

  <bean id="GWCGeoServerRESTConfigurationProvider" class="org.geoserver.gwc.layer.GWCGeoServerRESTConfigurationProvider">
    <description>
      XmlConfiguration contributor to set up XStream with GeoServer provided configuration objects for GWC's REST API
    </description>
    <constructor-arg ref="catalog"/>
  </bean>

  <!-- Specific URL mapping for GWC WMTS REST API -->
  <bean id="gwcWmtsRestUrlHandlerMapping" class="org.geoserver.gwc.controller.GwcUrlHandlerMapping">
    <constructor-arg ref="catalog" />
    <constructor-arg type="java.lang.String" value="/gwc/rest/wmts" />
    <property name="alwaysUseFullPath" value="true" />
    <property name="order" value="10" />
  </bean>

  <context:component-scan base-package="org.geowebcache.rest, org.geowebcache.diskquota.rest.controller" />

</beans>
